const mysql = require('mysql') // 引入 mysql
  
// 配置连接项
const connection = mysql.createConnection({
  host: 'localhost',
  user: 'root',
  password: 'root',
  port: '3306',
  database: 'learning'
})

connection.connect(error => {
  if (error) throw error;
  console.log("数据库链接成功")
})

module.exports = {
  connection
}
